package com.registration.controller;


import com.registration.Annotation.OperateLog;
import com.registration.bean.HealthReminderBean;
import com.registration.service.HealthReminderService;
import com.registration.util.JsonResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/api/v1")
public class HealthReminderController {

    @Autowired
    HealthReminderService healthReminderService;

    @GetMapping("/healthReminder")
    @OperateLog("获取用户提醒信息")
    public JsonResponse selectHealthRemindersByUserId(Integer user_id){
        List<HealthReminderBean> healthReminderBeanList=healthReminderService.selectHealthRemindersByUserId(user_id);
        if(healthReminderBeanList==null){
            return JsonResponse.fail("无此用户提醒信息");
        }else{
            return JsonResponse.success(healthReminderBeanList);
        }
    }

}
